package com.example.app1;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class ShapActivity extends AppCompatActivity implements View.OnClickListener {

    private View showView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shape);
        findViewById(R.id.showRect_btn).setOnClickListener(this);
        findViewById(R.id.showOvel_btn).setOnClickListener(this);
        showView = findViewById(R.id.show_shape);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.showRect_btn:
                showView.setBackgroundResource(R.drawable.rect_gold);
                break;
            case R.id.showOvel_btn:
                showView.setBackgroundResource(R.drawable.ovel_rose);
                break;
        }
    }
}
